import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random

import sim, main
from util import *
from dungeon import makeFloor, Room, TemplateRoom
import dungeon

template = \
"""
##############################
#########      &    ##########
######   .  %          #######
####    .    .     o     #####
###  .          %         ####
##.... %  .  .             ###
#......                     ##
#> % % %#    .        %      #
#...........     &            
#......    .                 #
#....                        #
#        .   %               #
###  .  .               .   ##
##              &          ###
####    o          .      ####
####       .            ######
######  .             ########
##############  ##############
"""[1:]

legend = {
    '#':    dungeon.rockGenerator(colors['Gray']),

    '&':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('mining equipment', 10, parole.map.AsciiTile('&',
                colors['Black']),
                blockMove=False, massNoun=True), clearFirst=False),

    '%':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('charred skeleton', 10, parole.map.AsciiTile('%',
                colors['Gray']),
                blockMove=False), clearFirst=False),
            
    'o':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('wooden support pillar', 100, parole.map.AsciiTile('o',
                colors['Brown']),
                blockMove=True, blockLOS=True), clearFirst=False),

    '.':    parole.map.MapObjectGenerator("", 
            lambda: sim.Obj('blasted rubble', 100, parole.map.AsciiTile(' ',
                colors['DarkGray'], bg_rgb=colors['DarkGray']),
                blockMove=True, massNoun=True), clearFirst=False),

    '>':    dungeon.downStairGenerator,
}

floorColor1 = colors['SandyBrown']
floorColor2 = colors['SaddleBrown']
floorName = 'dirt floor'
mixture = 0.5

diggable = [
    (12,0),
    (14,0),
    (15,0),
    (16,0),
    (15,17),
    (16,17),
    (0,9),
    (29,9),
]

class MessHall(TemplateRoom):
    def __init__(self, pos):
        TemplateRoom.__init__(self, template, legend, diggable, pos,
                floorColor1, floorColor2, mixture, floorName)

roomClass = MessHall

